// app/router.js
module.exports = app => {
    const { router, controller ,middleware,io} = app;
    router.post('/api/login', controller.user.login);
    router.post('/api/register', controller.user.register);
    io.of('/').route('server', io.controller.chat.ping);
    // console.log(app.io);
    router.get('/api/house/:type',middleware.auth(), controller.house.getHouse);
    router.get('/api/messgae',middleware.auth(),controller.message.getMessage)
    router.get('/api/group',middleware.auth(),controller.group.getGroupList)

    router.post('/api/groupDetail',middleware.auth(),controller.group.groupDetail)
    router.delete('/api/delGroupUser',middleware.auth(),controller.group.delGroupUser)
    router.post('/api/addGroup',middleware.auth(),controller.group.upDataGroup)
    router.post('/api/changeGroupState',middleware.auth(),controller.group.changeGroupState)
    //changeGroupState

    router.get('/api/demandBuy',middleware.auth(),controller.demand.getDemandBuy)
    router.get('/api/demandRent',middleware.auth(),controller.demand.getDemandRent)
    
    router.get('api/rankingList',middleware.auth(),controller.ranking.getRanking)

    router.get('/api/houseRing',middleware.auth(),controller.houseRing.HouseRingList)
    router.put('/api/addHouseRing',middleware.auth(),controller.houseRing.addHouseRing)
    router.delete('/api/delHouseRing',middleware.auth(),controller.houseRing.delHouseRing)

    
};